﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example02.aspx.cs" Inherits="Chapter35.Example02" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 35-2 为画布获取二维上下文对象</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    <style>
        canvas {
            border: medium double black;
            margin: 4px;
        }
    </style>
</head>
<body>
    <canvas id="canvas" width="500" height="200">Your browser doesn't support the <code>canvas</code> element.</canvas>
    <script>
        var ctx = document.getElementById('canvas').getContext('2d');
        ctx.fillRect(10, 10, 50, 50);
    </script>
</body>
</html>
